<template>
  <div class="message">
      <h4>图书馆留言</h4>
      <el-divider></el-divider>
      <div class="message_content">
        <el-card class="box-card">

    <el-row :gutter="15">
      <el-form ref="elForm" :model="problem" :rules="rules" size="medium" label-width="100px"
        label-position="left">
        <el-col :span="12">
          <el-form-item label-width="0" prop="field101">
            <el-select v-model="problem.field101" placeholder="请选择专业" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in field101Options" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item label-width="0" prop="field103">
            <el-input v-model="problem.field103" placeholder="请输入姓名" clearable
              prefix-icon='el-icon-user-solid' :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="19">
          <el-form-item label-width="0" prop="field104">
            <el-input v-model="problem.field104" placeholder="请输入联系方式" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="21">
          <el-form-item label-width="0" prop="field105">
            <el-input v-model="problem.field105" type="textarea" placeholder="请输入你的建议"
              :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
      <p class="title">请你放心，你发的信息会得到很好的隐私保存</p>
        </el-card>
      </div>
  </div>
</template>
<script>
    export default {
        components: {},
        props: [],
        data() {
            return {
                problem: {
                    field101: undefined,
                    field103: undefined,
                    field104: undefined,
                    field105: undefined,
                },
                rules: {
                    field101: [{
                        required: true,
                        message: '请选择专业',
                        trigger: 'change'
                    }],
                    field103: [{
                        required: true,
                        message: '请输入姓名',
                        trigger: 'blur'
                    }],
                    field104: [{
                        required: true,
                        message: '请输入联系方式',
                        trigger: 'blur'
                    }],
                    field105: [{
                        required: true,
                        message: '请输入你的建议',
                        trigger: 'blur'
                    }],
                },
                field101Options: [{
                    "label": "软件工程学院",
                    "value": 1
                }, {
                    "label": "网络工程学院",
                    "value": 2
                }, {
                    "label": "信息技术学院",
                    "value": 3
                }, {
                    "label": "经济管理学院",
                    "value": 4
                }, {
                    "label": "区块链学院",
                    "value": 5
                }, {
                    "label": "VR与艺术学院",
                    "value": 6
                }, {
                    "label": "新媒体学院",
                    "value": 7
                }, {
                    "label": "国际学院",
                    "value": 8
                }, {
                    "label": "创新学院",
                    "value": 9
                }, {
                    "label": "继续教育学院",
                    "value": 10
                }, ],

            }
        },
        computed: {},
        watch: {},
        created() {},
        mounted() {},
        methods: {
            submitForm() {
                this.$refs['elForm'].validate(valid => {
                    if (!valid) return
                        // TODO 提交表单
                })
            },
            resetForm() {
                this.$refs['elForm'].resetFields()
            },
        }
    }
</script>
<style>
    .message {
        width: 1200px;
        margin: 0 auto;
    }

    .message h4 {
        font-size: 18px;
        padding-top: 30px;
        color: #9B0B01;
        text-indent: 1.5em;
    }

    .message_content {
        margin: 15px;
    }

    .title {
        font-size: 12px;
        color: #666666;
    }
</style>
